<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/common.jsp"%>
<%@ include file="/WEB-INF/common/taglib.jsp"%>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style='width:100%;height:100%;overflow:scroll;overflow-x:hidden'>
	<div class="container bs-docs-container" style="width:100%;">
		<div class="row">
			<form role="pageForm" class="form-inline" action="<%=path%>/system/sysTableColumn/queryPageList.do" method="post"  id="pageForm" class="form-search">
				<div  class="col-md-12" style="width:100%;padding:5px;">
					<div class="panel panel-default">
						  <div class="panel-heading">列表界面</div>
						  <div class="panel-body">
						  		<div class="search">
									<div class="form-group col-sm-4">
										<label for="tableInfoId" class="col-sm-4 control-label" style="text-align:left;">表名</label>
								 		<div class="col-sm-8">
								 			<select name="tableInfoId" id="tableInfoId"  class="selectpicker show-tick form-control" data-live-search="true">
								 			 	 <option value="">请选择</option>
									 			 <c:if test="${not empty list}">
									 			 <c:forEach items="${list}" var="info" varStatus="vs">
											          <option value="${info.id}" <c:if test="${info.id == sysTableColumn.tableInfoId }">selected="selected"</c:if>>${info.tableName}</option>
											     </c:forEach>
											     </c:if>
								     		</select>
						           		</div>
						            </div>
									<div class="form-group col-sm-4">
										<label for="columnName" class="col-sm-4 control-label" style="text-align:left;">字段名</label>
								 		<div class="col-sm-8">
								 			<input type="text" name="columnName" id="columnName" placeholder="字段名" value="${sysTableColumn.columnName}" class="form-control">
						           		</div>
						            </div>
								 	<div class="form-group col-sm-4">
				     			 		<button type="submit" class="btn btn-sm btn-primary col-md-offset-1">搜索</button>
								 		<a type="button" class="btn btn-sm btn-primary" href="<%=path%>/system/sysTableColumn/toMerge.do" style="margin-left: 10px;">新增</a>
				       			 		<a type="button" class="btn btn-sm btn-info"    href="<%=path%>/system/sysTableColumn/sysTableColumn.do" style="margin-left: 10px;">同步表字段数据</a>
				       			 	</div>
						  		</div>
						        <div class="col-md-12 col-sm-12 col-xs-12 table-responsive"  style="padding-top: 5px;">
						        <table class="table table-striped table-condensed table-bordered table-hover">
							        <thead>
							        	<tr class="active">
							        		<th style="width:5%;">序号</th>
							        		<th style="width:8%;">表名</th>
											<th style="width:8%;">字段名</th>
											<th style="width:8%;">字段注释</th>
											<th style="width:5%;">字段类型</th>
											<th style="width:8%;">是否主键</th>
											<th style="width:8%;">是否查询条件</th>
											<th style="width:8%;">是否列表展示</th>
											<th style="width:8%;">新增是否展示</th>
											<th style="width:8%;">修改是否展示</th>
											<th style="width:8%;">详情是否展示</th>
										<!--  	<th style="width:10%;">创建时间</th>
											<th style="width:10%;">修改时间</th>-->
				                			<th style="width:10%;">操作</th>
			                			</tr>
							        </thead>
							        <tbody>
									        <c:choose>
												<c:when test="${not empty pagination}">
													<c:forEach items="${pagination.items}" var="info" varStatus="vs">
														<tr>
															<td>${vs.index+1}</td>
															<td>${info.tableName}</td>
															<td>${info.columnName}</td>
															<td>${info.columnComment}</td>
															<td>${info.columnType}</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isPrimary=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isPrimary=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isQuery=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isQuery=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isDisplay=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isDisplay=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isAdd=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isAdd=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isModify=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isModify=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<td>
																<c:choose> 
																  <c:when test="${info.isDetail=='1'}">是   
																  </c:when> 
																  <c:when test="${info.isDetail=='2'}">否 
																  </c:when> 
																  <c:otherwise></c:otherwise>    
																</c:choose> 
															</td>
															<!--  <td>
																<fmt:formatDate value="${info.createTime}" type="date"  pattern="yyyy-MM-dd HH:mm:ss"/>
															</td>
															<td>
																<fmt:formatDate value="${info.modifyTime}" type="date"  pattern="yyyy-MM-dd HH:mm:ss"/>
															</td>-->
															<td class="last">
																<a href="<%=path%>/system/sysTableColumn/toMerge.do?id=${info.id}">修改</a>
																&nbsp;&nbsp;
																<a onclick="HF.confirmx('确定删除该条数据','<%=path%>/system/sysTableColumn/delete.do?id=${info.id}')">删除</a>&nbsp;&nbsp;
															</td>
														</tr>
													</c:forEach>
												</c:when>
												<c:otherwise>
														<tr><td colspan="100">没有相关数据</td></tr>
												</c:otherwise>
											</c:choose>
							         </tbody>
							    </table>
							    </div>
								<div>
									<%@ include file="/WEB-INF/common/pagination.jsp"%>
								</div>
						  </div>	
					</div>
				</div>  
			</form>
		</div>
	</div>
</body>
</html>